<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
    <title>Title</title>
    <script src="/static/js/jquery.min.js"></script>
    <style type="text/css">
        img {
            width: 100px;
            height: 100px;
            display: block;
        }
        .link {
            height: 100px;
            width: 100%;
            display: block;
            color: #fff;
            font-size: 20px;
            text-align: center;
            line-height: 100px;
            background-color: #44b549;
        }
    </style>
</head>
<body>
<a class="link" href="itms-services://?action=download-manifest&url=https://www.17det.com/static/fuck.plist"> 下载 </a>

    <button style="display: none;" id="upload">upload</button>
    <input type="file" id="file" hidden>
    <script>
        $('#upload').click(function() {
            $('#file').trigger('click')
        })
        $('#file').on('change', function() {
            console.log('2222', $(this))
            var formData = new FormData()
            formData.append('file', this.files[0])
            $.ajax({
                url: '/upload',
                type: 'post',
                dataType: 'json',
                data: formData,
                cache: false,
                processData: false, // 不处理发送的数据，因为data值是Formdata对象，不需要对数据做处理
                contentType: false, // 不设置Content-type请求头
                success: function(res) {
                    console.log('res', res)
                    if (res.code !== 200) {
                        return
                    }
                    var images = res.data.urls
                    for (var i in images) {
                        $('body').append('<img src="' + images[i] + '"/>')
                    }
                },
                error: function (e) {
                    console.log(e);
                }
            })
        })
    </script>
</body>
</html>